package com.dtguai.app.api.form.login;

import com.dtguai.app.common.validator.group.AddGroup;
import com.dtguai.app.common.validator.group.LoginGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 登录表单
 *
 * @author guo
 * @date 2019年2月1日15:18:11
 */
@Data
@ApiModel(value = "登录")
public class LoginForm {

    @ApiModelProperty(value = "手机号", required = true, example = "18600231871")
    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class, LoginGroup.class})
    @Length(min = 11, max = 11, message = "请输入正确手机号", groups = {AddGroup.class, LoginForm.class})
    private String mobile;

    @ApiModelProperty(value = "密码", required = true, example = "123456")
    @NotBlank(message = "密码不能为空", groups = {AddGroup.class, LoginForm.class})
    @Length(min = 1, max = 20, message = "密码长度1-50", groups = {AddGroup.class, LoginForm.class})
    private String password;

    @ApiModelProperty(value = "imei号", required = true, example = "123456")
    @NotBlank(message = "imei号不能为空", groups = {AddGroup.class, LoginForm.class})
    private String imei;

    @ApiModelProperty(value = "数字签名", example = "1111")
    private String sign;

}
